package hello;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import tool.ESClient;

import java.awt.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Map;
import java.util.Set;

@Controller
public class GreetingController {


    @RequestMapping("/")
    public String index() {
        return "index";
    }
    @RequestMapping("/login")
    public String login(@RequestParam(value="username" ) String username,@RequestParam(value="password" ) String password, Model model) {
        System.out.println("username : "+username);
        System.out.println("password : "+password);
        return "list";
    }
    ESClient es = new ESClient();
   @RequestMapping("/search")
    public String search(@RequestParam(value="keywords" ) String keywords, Model model) {


       ArrayList<List> datas = new ArrayList<>();


       model.addAttribute("list",datas);




       model.addAttribute("keywords", keywords);
        return "list";
    }



}